﻿using System.ServiceModel.Activation;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using BLL;
using WcfServices.ServiceInterfaces;
using EntitiesLayer;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.Net;
using System.Data.SqlClient;
using WcfServices.Utilities;
using System.IO;
using System.Drawing;


namespace WcfServices
{
    
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class RolService: IRolService
    {
        private GestorMantRoles gestor;

        public RolService() {

            gestor = new GestorMantRoles();
        }




        public string Listar()
        {
            IEnumerable<Rol> listaRoles = Util.interceptWithReturn(gestor.ListarRoles);

            if (listaRoles != null)
                return listaRoles.JsonSerialize(ignoreTypes: new []{typeof(IList<>)});

            return "";

        }

        public string BuscarPorId(int id)
        {
            throw new System.NotImplementedException();
        }

        public void Delete(int id)
        {
            throw new System.NotImplementedException();
        }

        public void Update(Stream json)
        {
            throw new System.NotImplementedException();
        }

        public void Create(Stream json)
        {
            throw new System.NotImplementedException();
        }
    }
}
